#include<stdio.h>
#include<stdlib.h>
#include"engine.h"
#include"engine_int.h"
#include"javaclass.h"

int main (int argc, char * argv[])
{
  int * i;
  int * j;
  FILE *file;
  class_file * cf;

  start_jvm_thread();
  i = push_java (sizeof(int));
  j = push_java (sizeof(int));
  printf ("%x %x\n", i, j);
  pop_java (sizeof(int));
  pop_java (sizeof(int));


  file = fopen (argv[1],"rb");
  if(NULL != file) {
    cf = NULL;
    cf = read_class_file (file);
    print_code_attribute (cf->methods->attributes);
    fclose(file);
  } else {
    printf ("\nProblema abrir arquivo .class.");
  }
  stop_jvm_thread();  
  return EXIT_SUCCESS;
}
